/*
 * @Descripttion: your project
 * @version: 1.0
 * @Author: hongweixun
 * @Date: 2022-06-29 13:41:47
 * @LastEditors: hongweixun
 * @LastEditTime: 2022-09-30 12:00:48
 */
import { get, post, put } from '../../util/http'
// 获取当前登录者考勤规则的参数
export interface UserRecordParams {
    // 登录者id
    login_id: string
    // 固定标识 sourseRule
    type: string
}
// 根据课节等获取当前登录者考勤班级的学生名单的参数
export interface StudentParams {
    // 登录者id
    class_id: string
    // 固定标识 sourseRule
    type: string,
    // 日期
    date: string,
    // 课节id
    session_id: string,
    // 考勤结束时间
    attendance_e_time: any,
    // 页面来源， now-当前考勤 history-历史考勤
    page_type: string
}
// 提交考勤数据的参数
export interface RuleParams {
    // 日期
    date: string
    // 课节
    session_id: string,
    // 班级
    class_id: string,
    // 年级
    grade_id: string,
    // 学部
    faculty_id: string,
    // 1 正常签到 2.巡堂签到
    mode: string | number,
    // 登陆者id
    teacher_id: string,
    // 0 新增 1.编辑
    history_status: string | number,
    // 具体名单
    list: any
    // 备注
    remark?: string
}
// 获取历史考勤数据的参数
export interface HistoryParams {
    // type,固定值
    type: string
    // 日期
    date: string
    // 数据
    login_id: string
    // 班级
    class_id: string
    page_type: any
    // 页码
    page: number
    // 页码条数
    page_size: number
}
// 获取课节
export interface sessionParams {
    key_word: string,
    page_size: number,
    page: number,
    id: string
}
// 获取异常名单
export interface classRecordParams {
    type: string,
    login_id: string,
    search_id: string,
    search_type: string,
    session_id?: string,
    record_type?: string,
    date?: string,
    tab_type: string | number,
    student_name?: string,
    worker_name?: string,
    class_id?: string,
    worker_id?: string,
    student_id?: string,
    down?: string
}
export const getRuleApi = (obj: any) => get('/ClassAttendance/Rule/', obj)
// 巡检老师一键签到
export const putRuleApi = (obj: any) => put('/ClassAttendance/Record/', obj)
export const getStudentsApi = (obj: any) => get('/ClassAttendance/Record/', obj)
export const postRuleApi = (obj: any) => post('/ClassAttendance/Record/', obj)
// 获取历史考勤数据api
export const getHistoryListApi = (obj: any) => get('/ClassAttendance/Record/', obj)
// 获取班级树
export const getTreeForClass = (obj: object) => get('/SchoolUser/Class/', obj)
// 获取课节列表
export const getSessionList = (obj: object) => get('/Schedule/SessionApi/', obj)
// 获取异常名单列表
export const getErrorList = (obj: object) => get('/ClassAttendance/Record/', obj)
